Hey does anyone have any clue why filename is never getting allocated in the code below?
I read it afterwards and its giving me a seg fault.
Code:for (i = 1; i < (argc + 1); i++){ if (strcmp(argv[i], "-h") == 0){ /* -h operand is in command line */ isHtml = 1; } else if (strcmp(argv[i], "-f") == 0){ hasFilter = 1; if (argv[i + 1] != NULL){ filterfile = argv[++i]; } else{ fprintf(stderr, "Usage: tvprogs [-h] [-f filterfile] epgXMLfile"); return EXIT_FAILURE; } } else { filename = argv[i]; } }